package com.controller;

import com.alibaba.fastjson.JSONObject;
import com.utils.httpclient.ContentTypeEnum;
import com.utils.httpclient.HttpClientAssisstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.SortedMap;
import java.util.TreeMap;

@CrossOrigin
@RestController
@RequestMapping("/my")
public class MyTestController {







    @RequestMapping(value = "/test/httpClient", method = RequestMethod.GET,produces = "application/json;charset=utf-8")
    public String test() {
        //封装请求参数
        String s=null;
        try{
            String url="http://www.baidu.com/s?wd=%E5%8A%A8%E6%80%81&rsv_spt=1&rsv_iqid=0xaec8bfba00136d3b&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_sug3=8&rsv_sug1=5&rsv_sug7=100&rsv_sug2=0&inputT=3729&rsv_sug4=11145";
             s = HttpClientAssisstant.doGet(url, null, "utf-8");
            System.out.println("调用微信支付的统一下单接口的返回结果:  "+ s);
        }catch (Exception e){
            e.printStackTrace();
        }

        return s;
    }

}
